<?php
/** Mirror of the ContactManager class in java
 */
class ContactManager {
    // Contact interface
    /** updateContact
     * @param $token (string) Authentication token received during login
     * @param $contact (Contact object? FIXME) The Contact record to be updated
     * @return FIXME
     */
    function updateContact($token, $contact) {
        // stub
        if(!is_string($token) || (!is_object($contact)))
            throw new Exception('updateContact(): invalid data type passed');
    }
    
    
    
    /** deleteContact
     * @param $token (string) Authentication token received during login
     * @param $contact (Contact object? FIXME) The Contact record to be deleted
     * @return FIXME
     */
    function deleteContact($token, $contact) {
        // stub
        if(!is_string($token) || (!is_object($contact)))
            throw new Exception('deleteContact(): invalid data type passed');
    }
    
    /** getContact
     * @param $token (string) Authentication token received during login
     * @param $contactId (string) The ID of the Contact record to retrieve
     * @return (Contact object) The retrieved Contact record, or NULL on error
     */
    function getContact($token, $contactId) {
        // stub
        if(!is_string($token) || (!is_string($contactId)))
            throw new Exception('getContact(): invalid data type passed');
        $retval = NULL;
    }
    
    /** retrieveContacts
     * @param $token (string) Authentication token received during login
     * @param $query (string) The query used to inform the backend of which Contacts to return
     * @return (array of Contact objects) The retrieved Contact record(s), if any, or NULL on error
     */
    function retrieveContacts($token, $query) {
        // stub
        if(!is_string($token) || (!is_string($query)))
            throw new Exception('retrieveContacts(): invalid data type passed');
        $retval = NULL;    
    }
        
    /** countContacts
     * @param $token (string) Authentication token received during login
     * @param $query (string) The query used to inform the backend of which contacts to count
     * @return (int) The number of Contact records matching the query, or (-1) on error
     */
    function countContacts($token, $query) {
        // stub
        if(!is_string($token) || (!is_string($query)))
            throw new Exception('countContacts(): invalid data type passed');
        $retval = -1;
    }
}
?>
